package list

import (
	"github.com/therecipe/qt/widgets"
	"goplayer/uigen"
)

type SongsView struct{
	widgets.QWidget
	id int
	songModel *SongModel
	_ func() `constructor:"init"`
}

func (this *SongsView) SetData(data []*SongData,id int ){
	this.id = id
	this.songModel.SetThisValue(data)
}

func (this *SongsView) GetModel() *SongModel{
	return this.songModel
}

func (this *SongsView) init(){
	ui := new(uigen.UISongsView)
	ui.SetupUI(this.QWidget_PTR())
	this.songModel = NewSongModel(nil)
	ui.ListView.SetModel(this.songModel)
	delegate := InitDelegate()
	ui.ListView.SetItemDelegate(delegate)
}